﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Fis.Service.Forms
{
    public partial class SimplelListForm : ListBaseForm
    {
        public SimplelListForm()
        {
            InitializeComponent();
            barButtonItem3.Visibility = DevExpress.XtraBars.BarItemVisibility.Never;
        }

        protected virtual void AddNewProcess() { }
        protected virtual void ModifyProcess() { }
        protected virtual void DeleteProcess() { }
        protected virtual void RefreshProcess() { }
        protected virtual void FindProcess(object filter) { }

        private void barButtonItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            AddNewProcess();
        }

        private void barButtonItem2_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ModifyProcess();
        }

        private void barButtonItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            DeleteProcess();
        }

        private void barButtonItem4_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            RefreshProcess();
        }

        private void barEditItem1_EditValueChanged(object sender, EventArgs e)
        {
            FindProcess(barEditItem1.EditValue ?? string.Empty);
        }

        private void barEditItem1_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            barEditItem1.EditValue = string.Empty;
        }
    }
}
